<template>
  <div id="footer">
    <div class="main">
      <div class="aboutUs">
        <div class="ab-info">
          <div @click="handleUserAgree">用户协议</div>
          <div style="margin: 0 10px">|</div>
          <div @click="handlePrivacyPolicy">隐私政策</div>
        </div>
        <div class="det" @click="handVersionInformation">
          {{ store.getters.indexInfo.copyright || '' }}
        </div>
      </div>
      <div class="right-phone">
        <div>
          服务热线：<span class="phone">{{ phoneData || '-' }} </span>
        </div>
        <div>营业时间：<span>8.30-17.30</span></div>
      </div>
    </div>
  </div>
  <VersionInformation ref="versionInformationRef"> </VersionInformation>
</template>

<script setup>
import { computed, ref } from 'vue';
import { useRouter } from 'vue-router';
import { useStore } from 'vuex';
import { get } from 'lodash';
import { projmanager } from '@/api/projmanager.js';
import VersionInformation from './versionInformation.vue';

const versionInformationRef = ref(null);
const store = useStore();
const router = useRouter();
const phoneData = computed(() =>
  get(store.getters, 'indexInfo.mobile.kf_mobile[0]', ''),
);

const handleUserAgree = () => {
  router.push('/useragree');
};
const handlePrivacyPolicy = () => {
  router.push('/privacypolicy');
};
// 点击版本信息
const handVersionInformation = () => {
  // if (settingsStore.platformInfo.storeId === 0 && user.roleId === 2) {
  if (
    store.getters.user.userInfo.phone.includes('100000000') &&
    store.getters.user.platformInfo.storeId === 1
  ) {
    versionInformationRef.value.openChange(projmanager);
  }
};
// };
</script>

<style lang="scss" scoped>
#footer {
  color: #666;
  height: 130px;
  background: rgb(248, 248, 248);
  .main {
    display: flex;
    height: 100%;
    justify-content: space-between;
    align-items: center;
    .aboutUs {
      .ab-info {
        font-weight: 500;
        display: flex;
        cursor: pointer;
      }
      .det {
        font-size: 12px;
        margin-top: 30px;
        color: #999;
      }
    }
    .right-phone {
      .phone {
        font-size: 30px;
        font-weight: 400;
        color: #19b955;
      }
    }
  }
}
</style>
